<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <script type="text/javascript">
            function showDetail(rowKey){
                selectedRowDetail(rowKey);
            }
        </script>
        <style type="text/css">
            .active-row{
                background-color: #FFEBDA !important;
                cursor: pointer;
            }
        </style>
    </h:head>
    <h:body>
        <h:form>
            <rich:panel header="品目汇总表" styleClass="content-hight">
                <h:panelGrid columns="6" style=" text-align: left" >
                    <h:outputLabel value="年度:"/>
                    <h:selectOneMenu value="#{executTotalGovBean.iyear}">
                        <f:selectItem itemValue="" itemLabel="--请选择年度--"/>
                        <f:selectItems value="#{executTotalGovBean.yearli}"/>
                        <a4j:ajax event="change" render="qbutton"/>
                    </h:selectOneMenu>
                     <h:outputLabel value="计划状态："/>
                    <h:selectOneMenu value="#{executTotalGovBean.status}" >
                        <f:selectItem itemValue="" itemLabel="--请选择计划状态--"/>
                        <f:selectItems value="#{executTotalGovBean.selectItemList}"/>
                        <a4j:ajax event="change" render="qbutton"/>
                    </h:selectOneMenu>
                     <a4j:commandButton id="qbutton" value="查询" action="#{executTotalGovBean.queryliEight}"
                                       render="dataTabelArea,ebutton"
                                       onclick="this.disabled='true'"
                                       disabled="#{empty executTotalGovBean.iyear}"/>
                     <h:commandButton id="ebutton" value="导出Excel" action="#{executTotalGovBean.exportExcelEight}"
                                      disabled="#{executTotalGovBean.statsliEightModel.rowCount le 0}"/>
                </h:panelGrid>
                <h:panelGrid  style=" text-align: left" >
                <h:panelGroup id="dataTabelArea">                    
                    <div style="-moz-user-select:none;width:750px;height: 400px;overflow:auto" unselectable="on" onselectstart="return false;">
                        <rich:dataTable id="editTable" value="#{executTotalGovBean.statsliEightModel}" var="item" rowKeyVar="rowKey"
                                        rowClasses="list-row-odd,list-row-even" 
                                        headerClass="table-header"
                                        styleClass="tableStyle"
                                        style="width:1500px;margin-bottom: 5px"
                                        noDataLabel="无数据!">
                            <f:facet name="header">
                            <rich:columnGroup>
                                <rich:column colspan="19">
                                   品目汇总表
                                </rich:column>
                                <rich:column breakRowBefore="true" rowspan="2">序号</rich:column>
                                <rich:column rowspan="2">部门</rich:column>
                                <rich:column rowspan="2">品目</rich:column>
                                <rich:column colspan="3">
                                   资金性质
                                </rich:column>
                                <rich:column colspan="3">
                                   资金来源
                                </rich:column>
                                <rich:column colspan="4">
                                   组织形式
                                </rich:column>
                                <rich:column colspan="6">
                                   采购方式
                                </rich:column>
                                <rich:column breakRowBefore="true">小计</rich:column>
                                <rich:column>基本支出</rich:column>
                                <rich:column>项目支出</rich:column>
                                <rich:column>小计</rich:column>
                                <rich:column>财政资金</rich:column>
                                <rich:column>其他资金</rich:column>
                                <rich:column>小计</rich:column>
                                <rich:column>集中采购</rich:column>
                                <rich:column>部门集中采购</rich:column>
                                <rich:column>分散采购</rich:column>
                                <rich:column>小计</rich:column>
                                <rich:column>公开招标</rich:column>
                                <rich:column>邀请招标</rich:column>
                                <rich:column>竞争性谈判</rich:column>
                                <rich:column>单一来源</rich:column>
                                <rich:column>询价</rich:column>
                            </rich:columnGroup>
                            </f:facet>
                            <rich:column>
                                <h:outputText value="#{rowKey+1}"/>
                            </rich:column>
                            <rich:column>
                                <h:outputText value="#{item.deptName}" rendered="#{empty item.cateName}" />
                                <h:outputText value="合计" rendered="#{empty item.deptName}" />
                            </rich:column>
                            <rich:column>                                
                                <h:outputText value="#{item.cateName}"/>                                
                            </rich:column>
                            <rich:column style="text-align:right">                                
                                <h:outputText value="#{item.total1 + item.total2}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                            </rich:column>
                            <rich:column style="text-align:right">                              
                                <h:outputText value="#{item.total1}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                            </rich:column>
                             <rich:column style="text-align:right">
                                <h:outputText value="#{item.total2}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                             <rich:column style="text-align:right">
                                 <h:outputText value="#{item.total11 + item.total12}">
                                     <f:convertNumber type="double" pattern="###,##0.00"/>
                                 </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total11}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total12}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total3 + item.total4 + item.total5}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total3}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total4}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total5}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total6 + item.total7 + item.total8 + item.total9 + item.total10}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total6}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total7}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total8}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total9}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                                <rich:column style="text-align:right">
                                <h:outputText value="#{item.total10}">
                                    <f:convertNumber type="double" pattern="###,##0.00"/>
                                </h:outputText>
                             </rich:column>
                        </rich:dataTable>
                    </div>
                </h:panelGroup>
                </h:panelGrid>
            </rich:panel>
        </h:form>
    </h:body>
</ui:composition>
